//
//  loginCell.m
//  Focus
//
//  Created by dlios on 14-11-10.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "loginCell.h"
#import "UIImageView+WebCache.h"
@implementation loginCell
-(void)dealloc{
    [super dealloc];
   
    [_myImageView release];
    [_login release];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImageView *myImageView = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.myImageView = myImageView;
        [myImageView release];
        [self.contentView addSubview:self.myImageView];
        
        UILabel *login = [[UILabel alloc]initWithFrame:CGRectZero];
        self.login = login;
        [login release];
        [self.contentView addSubview:self.login];
        
        
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
    NSNotificationCenter *notiCenter = [NSNotificationCenter defaultCenter];
    [notiCenter addObserver:self selector:@selector(receiveNotification:) name:@"cesuo" object:nil];
    
    NSNotificationCenter *notiCenter1 = [NSNotificationCenter defaultCenter];
    [notiCenter1 addObserver:self selector:@selector(receiveNotification1:) name:@"cesuo1" object:nil];
    NSNotificationCenter *notiCenter2 = [NSNotificationCenter defaultCenter];
    [notiCenter2 addObserver:self selector:@selector(receiveNotification2:) name:@"cesuo2" object:nil];
    
    NSNotificationCenter *notiCenter3 = [NSNotificationCenter defaultCenter];
    [notiCenter3 addObserver:self selector:@selector(receiveNotification3:) name:@"cesuo3" object:nil];
    
       self.myImageView.frame = CGRectMake(10, 20, 50, 50);
    
    self.login.frame = CGRectMake(125,45, 60, 20);
    self.login.font = [UIFont systemFontOfSize:14];
}
- (void)receiveNotification:(NSNotification *)noti
{
   
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",noti.object]]];
   
    
}
- (void)receiveNotification1:(NSNotification *)noti
{
    
    self.login.text = noti.object;
    self.login.font = [UIFont systemFontOfSize:10];
    
}
-(void)receiveNotification2:(NSNotification *)noti{
    self.myImageView.image = noti.object;
}
-(void)receiveNotification3:(NSNotification *)noti{
    self.login.text = noti.object;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
